package router

import (
	"github.com/gin-gonic/gin"
	"xiao-hong-book/handler"
)

func Init() *gin.Engine {

	r := gin.Default()

	//r.GET("/", func(c *gin.Context) {
	//	c.String(http.StatusOK, "hello World!")
	//})
	r.POST("/add", handler.Add)       //添加
	r.POST("/upload", handler.Upload) //文件上传
	r.GET("/list", handler.List)      //列表展示
	r.Static("/static", "./static")
	return r
}
